<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>修改会员信息</title>
</head>
<?php
  require 'common/user.dao.php';   //引入用户数据表数据访层
 //启动Session
	  session_start(); 	      
	  if(!isset($_SESSION['userinfo'])){
	     echo "<script>alert('登录后才可以修改用户信息，请先登录>>>>');location.href='login.php';</script>";		
	  } 
   $userinfo = $_SESSION['userinfo'];
   $uid=$userinfo['id'];//取登录用户的编号    
   $row= findUserById($uid);  

?>
<body>
<form method="post" action="doUpdateuser.php">
	     <table class="table">
		    <tr><th>用户名：</th><td><input type="text" name="uname" class="form-text"   value="<?php echo $row['uname']?>"  readonly="true"></td></tr>
            <tr><th>电子邮件：</th><td><input type="email" name="uemail"  class="form-text" value="<?php echo $row['uemail']?>"/></td></tr>
            <tr><th>性别：</th><td>
            <?php if($row['gender']=='男'){?>
              <input type="radio" name="gender" value="1" checked="checked" >男
              <input type="radio" name="gender" value="2" >女
             <?php 
			}else{
			 ?>
              <input type="radio" name="gender" value="1"  >男
              <input type="radio" name="gender" value="2" checked="checked">女
             <?php
			}
			 ?>
             <input type="hidden" name="uid" value="<?php echo $uid?>">
             </td></tr>                         
		<tr>
			<td colspan="2" align="center"><input type="submit" value="确认修改" class="form-btn">　<input type="reset" value="重新填写" class="form-btn"></td>
		</tr>
	</table>
	</form>
</body>
</html>